﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataCoreTechnologies.SqlServer
{
   internal static class Factory
   {
      /// <summary>
      /// Creates an instance of a check constraint and associates it with the column specified by the parameter.
      /// </summary>
      /// <param name="container">The column this check constraint is associated with.</param>
      internal static CheckConstraint GetCheckConstraint(Column container)
      {
         return new CheckConstraint(container);
      }
      /// <summary>
      /// Creates an instance of a column.
      /// </summary>
      internal static Column GetColumn()
      {
         return new Column();
      }
      /// <summary>
      /// Creates a database and associates it with the server specified by the parameter.
      /// </summary>
      /// <param name="container">The server containing this database.</param>
      internal static Database GetDatabase(Server container)
      {
         return new Database(container);
      }
      /// <summary>
      /// Creates an instance of a default value and associates it with the column indicated by the parameter.
      /// </summary>
      /// <param name="container">The parameter this default value is being applied against.</param>
      internal static DefaultValue GetDefaultValue(Column container)
      {
         return new DefaultValue(container);
      }
      /// <summary>
      /// Creates an instance of a extended property with this initial values specified by the parameters.
      /// </summary>
      /// <param name="name">The name of this extended property.</param>
      /// <param name="value">The value in this extended property.</param>
      internal static ExtendedProperty GetExtendedProperty(string name, string value)
      {
         return new ExtendedProperty(name, value);
      }
      /// <summary>
      /// Creates a foreign key and associates it to the table specified by the parameter.
      /// </summary>
      /// <param name="container">The table this foreign key belongs to.</param>
      internal static ForeignKey GetForeignKey(Table container)
      {
         return new ForeignKey(container);
      }
      /// <summary>
      /// Creates a foreign key column class that represents a pair of columns that are part of a foreign key.
      /// </summary>
      /// <param name="parentColumn">The column that contains the data that is being pointed to.</param>
      /// <param name="referenceColumn">
      /// The column that contains the data that is pointing towards the parent column.
      /// </param>
      internal static ForeignKeyColumns GetForeignKeyColumns(Column parentColumn, Column referenceColumn)
      {
         return new ForeignKeyColumns(parentColumn, referenceColumn);
      }
      /// <summary>
      /// Creates a function and associates it with the schema specified by the parameter.
      /// </summary>
      /// <param name="container">The schema this function belongs to.</param>
      internal static Function GetFunction(Schema container)
      {
         return new Function(container);
      }
      /// <summary>
      /// Creates an index and associates it with the table indicated by the parameter.
      /// </summary>
      /// <param name="container">The table this index belongs to.</param>
      internal static Index GetIndex(Table container)
      {
         return new Index(container);
      }
      /// <summary>
      /// Creates an index and associates it with the view indicated by the parameter.
      /// </summary>
      /// <param name="container">The view this index belongs to.</param>
      internal static Index GetIndex(View container)
      {
         return new Index(container);
      }
      /// <summary>
      /// Creates an index and associates it with the primary key indicated by the parameter.
      /// </summary>
      /// <param name="container">The primary key this index belongs to.</param>
      internal static Index GetIndex(PrimaryKey container)
      {
         return new Index(container);
      }
      /// <summary>
      /// Creates a index column and associates it with the index specified by the parameter.
      /// </summary>
      /// <param name="container"></param>
      internal static IndexColumn GetIndexColumn(Index container)
      {
         return new IndexColumn(container);
      }
      /// <summary>
      /// Creates a parameter and associates it to the stored procedure specified by the parameter.
      /// </summary>
      /// <param name="container">The stored procedure this parameter belongs to.</param>
      internal static Parameter GetParameter(StoredProcedure container)
      {
         return new Parameter(container);
      }
      /// <summary>
      /// Creates a parameter and associates it to the function specified by the parameter.
      /// </summary>
      /// <param name="container">The function this parameter belongs to.</param>
      internal static Parameter GetParameter(Function container)
      {
         return new Parameter(container);
      }
      /// <summary>
      /// Creates a instance of a primary key belonging to the table specified by the parameter.
      /// </summary>
      /// <param name="container">The table this primary key belongs to.</param>
      internal static PrimaryKey GetPrimaryKey(Table container)
      {
         return new PrimaryKey(container);
      }
      /// <summary>
      /// Creates an instance of a schema and associates it to the database specified by the parameter.
      /// </summary>
      /// <param name="container">The database that this schema belongs to.</param>
      internal static Schema GetSchema(Database container)
      {
         return new Schema(container);
      }
      /// <summary>
      /// Creates a stored procedure and associates it to the schema specified by the parameter.
      /// </summary>
      /// <param name="container">The schema this stored procedure belongs to.</param>
      internal static StoredProcedure GetStoredProcedure(Schema container)
      {
         return new StoredProcedure(container);
      }
      /// <summary>
      /// Creates a instance of a system type that belongs to the database indicated by the parameter.
      /// </summary>
      /// <param name="container">The database this system type belongs to.</param>
      internal static SystemType GetSystemType(Database container)
      {
         return new SystemType(container);
      }
      /// <summary>
      /// Creates a table and associates it to the schema specified by the parameter.
      /// </summary>
      /// <param name="container">The schema this table belongs to.</param>
      internal static Table GetTable(Schema container)
      {
         return new Table(container);
      }
      /// <summary>
      /// Creates an instance of a trigger and associates it with the table specified by the parameter.
      /// </summary>
      /// <param name="container">The table this trigger is run against.</param>
      internal static Trigger GetTrigger(Table container)
      {
         return new Trigger(container);
      }
      /// <summary>
      /// Creates an instance of a trigger and associates it with the view specified by the parameter.
      /// </summary>
      /// <param name="container">The view this trigger is run against.</param>
      internal static Trigger GetTrigger(View container)
      {
         return new Trigger(container);
      }
      /// <summary>
      /// Creates an instance of a database and associates it with the table specified by the parameter.
      /// </summary>
      /// <param name="container">The database this trigger is run against.</param>
      internal static Trigger GetTrigger(Database container)
      {
         return new Trigger(container);
      }
      /// <summary>
      /// Creates an instance of a user type.
      /// </summary>
      internal static UserType GetUserType()
      {
         return new UserType();
      }
      /// <summary>
      /// Creates a view and associates it to the schema specified by the parameter.
      /// </summary>
      /// <param name="container">The schema this view belongs to.</param>
      internal static View GetView(Schema container)
      {
         return new View(container);
      }
   }
}
